package com.armani.mapper;

import com.armani.entity.ItemImage;
import com.armani.model.ImgModel;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @ClassName ImgMapper
 * @Description 商品图片映射接口
 * @Author Admin
 * @Date 2021/11/27 17:48
 * @Version 1.0
 **/

public interface ImgMapper {
    List<ItemImage> pageSearch(@Param(value = "startRow") Integer startRow,
                               @Param(value = "limit") Integer limit,
                               @Param(value = "id") Integer id);

    Integer getCount(@Param(value = "id") Integer id);

    Integer insert(@Param(value = "image") String image,
                   @Param(value = "descrip") String descrip,
                   @Param(value = "skuId") Integer skuId,
                   @Param(value = "sort") Integer sort,
                   @Param(value = "master") Integer master,
                   @Param(value = "state") Integer state,
                   @Param(value = "lastTime") Date lastTime);

    Integer update(@Param(value = "id") Integer id,
                   @Param(value = "image") String image,
                   @Param(value = "descrip") String descrip,
                   @Param(value = "skuId") Integer skuId,
                   @Param(value = "sort") Integer sort,
                   @Param(value = "master") Integer master,
                   @Param(value = "state") Integer state,
                   @Param(value = "lastTime") Date lastTime);

    Integer delete(@Param(value = "id") Integer id);

    /**
     * 根据skuId查图片列表
     *
     * @param skuId 商品sku的id
     * @return 图片列表集合
     */
    List<ImgModel> searchBySkuId(Integer skuId);

    /**
     * 添加商品sku图片
     *
     * @param imgModel 图片参数
     * @return 影响行
     */
    Integer insertImg(ImgModel imgModel);


}
